#pragma once
#include <iostream>

#include "RBTree.h"

void test1()
{
	MyBRTree::RBTree<int, int> rb1;

	for (int i = 10;i < 15;i++)
	{
		rb1.insert({ i,i });
	}
	for (int i = 0;i < 5;i++)
	{
		rb1.insert({ i,i });
	}
	for (int i = 25;i < 30;i++)
	{
		rb1.insert({ i,i });
	}
	for (int i = 5;i < 10;i++)
	{
		rb1.insert({ i,i });
	}
	for (int i = 15;i < 20;i++)
	{
		rb1.insert({ i,i });
	}
	for (int i = 20;i < 30;i++)
	{
		rb1.insert({ i,i });
	}
	rb1.InOrder();
	MyBRTree::RBTree<int, int> rb2(rb1);
	rb2.InOrder();
	rb1.clear();
	rb1.InOrder();
	rb1 = rb2;
	rb1.InOrder();
	std::cout << rb1.Hight() << std::endl;
	std::cout << rb2.Hight() << std::endl;

	std::cout << rb1.BlackNum() << ' ' << rb1.IsBRTree() << std::endl;
	std::cout << rb2.BlackNum() << ' ' << rb2.IsBRTree() << std::endl;
}
void test2()
{
	MyBRTree::RBTree<int, int> rb1;
	rb1.insert({ 10,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 11,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 12,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 13,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 14,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 0,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 1,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 2,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 3,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 4,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 25,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 26,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 27,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 28,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 29,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 5,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 6,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 7,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 8,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 9,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 15,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 16,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 17,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 18,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 19,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 15,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 20,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 21,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 22,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 23,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 24,0 });
	rb1.LevelOrderPrint();
	rb1.insert({ 25,0 });
	rb1.LevelOrderPrint();
}

int main()
{
	//test1();
	test2();
	return 0;
}